<template>
  <div class="content">
    <div class="topSearch">
      <input type="text" placeholder="please enter">
      <div class="searchBtn">
        <img src="@/assets/loginImgs/search.png" alt="">
      </div>
    </div>
    <div class="artral">
      <div class="artral-left">
        <div class="left-top">
          <div class="left-date">The Cellege</div>
        </div>
        <div class="left-center" @click="toLink(item.id)">
          <div class="leftImg">
            <img src="@/assets/loginImgs/code.png" alt="">
          </div>
          <div class="leftDsc">
            <div class="dsc">
              Cross border quality suppliers have the ability
            </div>
            <div class="date">
              As the saying goes: "those who win the supply chain win the world.
              However, the supply chain is a problem that many cross-border
              e-comm erce enterprises cannot solve. In the context of global
              consumer demand and experience upgrading, what kind of
              capabilities do suppliers n eed to have in 2020 to win the year?
            </div>
          </div>
        </div>
        <div class="left-center" @click="toLink(item.id)">
          <div class="leftImg">
            <img src="@/assets/loginImgs/code.png" alt="">
          </div>
          <div class="leftDsc">
            <div class="dsc">
              Cross border quality suppliers have the ability
            </div>
            <div class="date">
              As the saying goes: "those who win the supply chain win the world.
              However, the supply chain is a problem that many cross-border
              e-comm erce enterprises cannot solve. In the context of global
              consumer demand and experience upgrading, what kind of
              capabilities do suppliers n eed to have in 2020 to win the year?
            </div>
          </div>
        </div>
        <div class="left-center" @click="toLink(item.id)">
          <div class="leftImg">
            <img src="@/assets/loginImgs/code.png" alt="">
          </div>
          <div class="leftDsc">
            <div class="dsc">
              Cross border quality suppliers have the ability
            </div>
            <div class="date">
              As the saying goes: "those who win the supply chain win the world.
              However, the supply chain is a problem that many cross-border
              e-comm erce enterprises cannot solve. In the context of global
              consumer demand and experience upgrading, what kind of
              capabilities do suppliers n eed to have in 2020 to win the year?
            </div>
          </div>
        </div>
        <div style="text-align: center;">
          <el-pagination
            v-if="tableData.length"
            background
            :current-page="pageNo"
            :page-size="pageSize"
            :total="total"
            layout="prev, pager, next"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </div>
      <div class="artral-right">
        <div class="right-title">
          <div class="title-name">
            <span>Latest courses</span>
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
          <div class="content-name">
            However, the supply chain is a problem that many cross-b order
            e-commerce enterprises cannot solve
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { articlePage } from '@/api/article';
export default {
  data() {
    return {
      tableData: [],
      loading: false,
      pageNo: 1,
      pageSize: 10,
      nextId: '',
      preId: ''
    };
  },
  mounted() {
    // this.init()
  },
  methods: {
    init() {
      this.loading = true;
      articlePage({
        beginCreateTime: '',
        endCreateTime: '',
        title: '',
        type: 0,
        pageNo: this.pageNo,
        pageSize: this.pageSize
      }).then(res => {
        this.tableData = res.data.data;
        this.tableData.map(val => {
          val.publishedTime = val.publishedTime.split(' ')[0];
        });
        this.total = res.data.totalCount;
        this.loading = false;
      });
    },
    toLink(id, index) {
      this.$router.push({
        path: '/home/newsDetial',
        query: { id: id }
      });
    },
    handleSizeChange(val) {
      this.pageSize = val;
      this.init();
    },
    handleCurrentChange(val) {
      this.pageNo = val;
      this.init();
    }
  }
};
</script>
<style lang="scss">
.el-pagination .active {
  background-color: #02a152 !important;
}
</style>
<style lang="scss" scoped>
.content {
  width: 100%;
  height: 100%;
  padding: calc(100vw / 27.42) 0;
  // overflow: hidden;
  background: rgba(249, 249, 249, 1);
}
::v-deep .el-pagination .active {
  background-color: #02a152 !important;
}
.topSearch {
  // width: calc(100vw / 1.9);
  height: calc(100vw / 20);
  text-align: center;
  margin: calc(100vw / 30) auto calc(100vw / 45.71) auto;
  overflow: hidden;
  border-radius: calc(100vw / 480) 0 0 calc(100vw / 480);

  input {
    width: calc(100vw / 2.05);
    height: calc(100vw / 30);
    padding: 0 calc(100vw / 48);
    line-height: calc(100vw / 30);
    margin: 10px 0;
    font-size: calc(100vw / 73.85);
    color: #666666;
    background: rgba(255, 255, 255, 1);
    border: none;
    box-shadow: 0px calc(100vw / 960) calc(100vw / 192) rgba(0, 0, 0, 0.16);
    border-radius: calc(100vw / 480) 0 0 calc(100vw / 480);
  }
  .searchBtn {
    width: calc(100vw / 30);
    height: calc(100vw / 30);
    text-align: center;
    background: rgba(2, 161, 82, 1);
    margin: 10px 0;
    border-radius: 0px calc(100vw / 480) calc(100vw / 480) 0px;
    display: inline-block;
    vertical-align: bottom;
    img {
      width: calc(100vw / 73.85);
      height: calc(100vw / 73.85);
      margin-top: calc(100vw / 30 / 2 - 100vw / 73.85 / 2);
    }
  }
}
.artral {
  width: calc(100vw / 1.12);
  margin: 0 auto;
  margin-top: calc(100vw / 38.4);
  vertical-align: top;
  &-left {
    width: calc(100vw / 1.63);
    display: inline-block;
    padding: calc(100vw / 80) calc(100vw / 64) calc(100vw / 53.33)
      calc(100vw / 64);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 0px calc(100vw / 240) rgba(0, 0, 0, 0.16);
    opacity: 1;
    border-radius: calc(100vw / 480) 0px calc (100vw / 480) calc(100vw / 480);
    .left-top {
      width: calc(100vw / 1.72);
      margin: 0 auto;
      display: flex;
      line-height: calc(100vw / 64);
      justify-content: space-between;
    }
    .left-center {
      line-height: calc(100vw / 71.11);
      font-size: calc(100vw / 106.67);
      color: rgba(102, 102, 102, 1);
      padding: calc(100vw / 60);
      display: flex;
      justify-content: space-between;
      border-top: 2px solid #e6e6e6;
      .leftImg {
        width: calc(100vw / 5.33);
        height: calc(100vw / 8);
        display: inline-block;
        border-radius: calc(100vw / 480);
        img {
          width: 100%;
          height: 100%;
        }
      }
      .leftDsc {
        width: calc(100vw / 3.03);
        height: calc(100vw / 8);
        display: inline-block;
        vertical-align: bottom;
        .dsc {
          font-size: calc(100vw / 68.57);
          color: #333333;
          font-weight: 600;
          margin: calc(100vw / 160) 0;
          padding-left: calc(100vw / 192);
          border-left: calc(100vw / 480) solid #02a152;
        }
        .date {
          font-size: calc(100vw / 80);
          line-height: calc(100vw / 64);
          color: #666666;
        }
      }
    }
    .left-date {
      font-size: calc(100vw / 80);
      padding: 0 calc(100vw / 128);
      color: rgba(102, 102, 102, 1);
      display: inline-block;
      border-bottom: calc(100vw / 384) solid rgba(2, 161, 82, 1);
    }
  }
  &-right {
    vertical-align: top;
    display: inline-block;
    margin-left: calc(100vw / 64);
    background: #ffffff;
    box-shadow: 0px 0px calc(100vw / 240) rgba(0, 0, 0, 0.16);
    border-radius: calc(100vw / 480) 0px calc (100vw / 480) calc(100vw / 480);
    .right-title {
      width: calc(100vw / 3.82);
      margin: 0 auto;
      padding: calc(100vw / 80) calc(100vw / 91.43);
      .title-name {
        text-align: center;
        margin-bottom: calc(100vw / 96);
        span {
          font-size: calc(100vw / 80);
          color: #333333;
          font-weight: 600;
          font-family: Segoe UI;
          border-bottom: calc(100vw / 480) solid #02a152;
        }
      }
      .content-name {
        padding: calc(100vw / 192) 0;
        color: #666666;
        font-size: calc(100vw / 106.67);
        border-bottom: calc(100vw / 1920) solid #e6e6e6;
      }
      p {
        padding-top: calc(100vw / 64);
        font-weight: 600;
      }
    }
  }
}
</style>
